Skip to content

Support NotFound content rendering for a custom Router #62635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ilonatommy
Copy link
Member

@ilonatommy ilonatommy commented Jul 9, 2025

This PR:

  • Removes support for NotFound fragment - it cannot be rendered using NavigationManager.NotFound(). UPDATE DOCS
  • Fixes issues with raising NotFound event after async operations.
  • Adds support for raising NotFound event without blazor default Router component.

Implementation description

Moves handling 404 signal from endpoint renderer to the endpoint invoker.
Communicates the the renderer that Router handled rendering of NotFoundPage by setting the Path in NotFoundEventArgs. If that property is not set, router treats the request as not handled, cleans the response and avoids flushing in order to allow re-execution middleware act.

Fixes #62367, Fixes #62469

@ilonatommy ilonatommy added this to the 10.0-preview7 milestone Jul 9, 2025
@ilonatommy ilonatommy self-assigned this Jul 9, 2025
@ilonatommy ilonatommy added the area-blazor Includes: Blazor, Razor Components label Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
1 participant